<?php
/**
 * Created by PhpStorm.
 * User: zhang-hong
 * Date: 2017/4/11
 * Time: 11:28
 * 功 能: 获取病房巡查列表--用于Android端的service同步数据
 */
class GetbingfangxunchadatajsonController extends Yaf_Controller_Abstract
{

    function IndexAction()
    {
        $request = $this->getRequest();
        $user_department = $request->getPost("user_department","");
        $user_department_id = $request->getPost("zhuyuan_id","");
        $modify_time = $request->getPost("modify_time","");
        $jsonData = $request->getPost("data","");
        $compression_http_data = $request->getPost("compression_http_data","off");
        $yiyuan_id = $request->getPost("yiyuan_id","");
        $bingfang_mode = new BingFangChaXunModel();

        // 解压缩数据
        $jsonData = Utility::uncompress($jsonData,$compression_http_data);

        //获取标本信息
        $bingfang_data = $bingfang_mode->getBingfangXunchaSql($user_department_id,$user_department,$jsonData,$modify_time);
        foreach($bingfang_data as $key => $one_data)
        {
            $async_result["update_sql"][$key] = $one_data;
        }
        $async_result["state"] = 1;
        $async_result["response_info"] = "数据同步成功:)";
        if(empty($async_result["update_sql"])){
            $async_result["update_sql"] = array();
        }
        $async_result['error'] = 200;
        $async_result['msg'] = "";
        Utility::apiJsonResultExtends($async_result);
    }
}